import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';

import '../login/login_conf.dart';
import 'home_conf.dart';
import 'home_state.dart';

class HomeLogic extends GetxController {
  final HomeState state = HomeState();
  var name = 'home'.obs;
  @override
  void onInit() {
    var args = Get.arguments;

    if (args is HomeArgs) {

      state.userModel = args.userModel;
      state.userModel2 = args.rxUserModel;
      state.userModel3.value= args.userModel;

    }
    super.onInit();
  }

  HomeLogic() {

    print('HomeLogic实例被创建');

  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() async {
    print('JtTag:HomeLogic:onClose');

    super.onClose();
  }

  check(){
    print('JtTag:login查看userModel:${state.userModel.toJson()}');
    print('JtTag:login查看userModel2:${state.userModel2.value.toJson()}');
  }
}
